<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>合伙人业务管理</title>
    <script src="__INDEX__/js/mui.min.js"></script>
	<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
	<link rel="stylesheet" href="__INDEX__/css/style.css" />
	<link rel="stylesheet" href="__INDEX__/css/mall.css" />	
	<script type="text/javascript" src="__INDEX__/dist/jquery.min.js" ></script>
	<script type="text/javascript" src="__INDEX__/js/menudown.js" ></script>
	<style>
		.record_list2 .l4{
			width:16.6%;
		}
	</style>
</head>
<body>
	<div class="mui-content">
	    {include file="public/member" /}
	    <div class="glj_bt"><span class="mui-icon iconfont icon-dingdan4"></span><em style="padding-left: 20px;">合伙人管理/合伙人下单业务管理</em></div>
	    <div class="glj_bt1"><em style="padding-left: 20px;">合伙人下单列表</em></div>
	     <div class="glj_bt1"><input style="font-size:12px;width:200px;height: 30px;line-height: 30px;border-radius: 15px;" id="name" type="text" placeholder="搜索姓名、手机号、会员编号"/>
	     <em style="padding-left: 20px;"></em><a href="#" onclick="find()">搜索</a></div>
	   
	   <ul class="record_list2">
	    	<li class="clearfix">
	    		<div class="l4">合伙人</div>
	    		<div class="l4">订购产品</div>
	    		<div class="l4">订购数量</div>
	    		<div class="l4">下单金额</div>
	    		<div class="l4">下单时间</div>
	    		<div class="l4">交易审核</div>
    		</li>
	    </ul>
	   <ul class="record_list2 re">
	    	
	    </ul>
		<p id="no_record" style="color:#D6AA50;text-align: center;display: none;">数据已加载完毕</p>
	</div>
	<input type="hidden" id="page" value="1" />
			{include file="public/bottom" /}
</body>
</html>
	{include file="public/footer" /}
<script src="__PUBLIC__/static/js/mui.min.js"></script>
<script>
	function find(){
		$("#page").val(1);
		get_data();
	}
	get_data();
	function get_data(){
			$.ajax({
			type:"post",
			data:{
				name:$("#name").val(),
				page:$("#page").val()
			},
			url:"{:url('index/city/dinghuo_list')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list&&list.length>0){
					$("#page").val(parseFloat($("#page").val())+1);
					for(var i=0;i<list.length;i++){
						var num=i+1;
						var log=list[i];
						var status=log['status'];
						if(status==1){
							status="待审核";
						}
						html+='<li class="clearfix">'+
				    		'<div class="l4">'+log['name']+'<br/>ID'+log['user_id']+'</div>'+
				    		'<div class="l4">'+log['goods_name']+'</div>'+
				    		'<div class="l4">'+log.nums+'</div>'+
				    		'<div class="l4">'+log['money']+'</div>'+
				    		'<div class="l4">'+log.add_time+'</div>'+
				    		'<div class="l4" onclick="sh('+log.id+',this)">'+status+'</div>'+
			    			'</li>';
					}
				}else{
					$("#no_record").show();
				}
				$(".re").html(html);
				
			}
		});
	}
	function sh(id,obj){
			 layer.prompt({title: '请输入审核信息', formType: 3}, function(val, index){
		 		if(val==""){
		 			alert("请输入审核信息!");
		 			return;
		 		}
		 		$.ajax({
					type:"post",
					url: "{:url('city/dh_sh')}",
					data: {id : id,status:val},//表单数据
					success: function(data) {
						$(obj).text(val);
						layer.msg(data.msg, {
						  icon: 1,
						  time: 1500 //2秒关闭（如果不配置，默认是3秒）
						}, function(){
							 
						}); 
					}
				})
			    layer.close(index);
			    
		  });
	
	}
	$(window).scroll(function(){
		var scrollTop = $(window).scrollTop();       //滚动条高度
		var bodyheight = $(document).height();         //文档的高度
		var windowheight = window.innerHeight;	//$(window).height();              //当前窗体的高度
		if((bodyheight - windowheight - scrollTop) == 0){
			$.ajax({
			type:"post",
			data:{
				name:$("#name").val(),
				page:parseFloat($("#page").val())
			},
			url:"{:url('index/city/dinghuo_list')}",
			success:function(data){	
				var list=data.list;
				var html="";
				if(list&&list.length>0){
					$("#page").val(parseFloat($("#page").val())+1);
					for(var i=0;i<list.length;i++){
						var num=i+1;
						var log=list[i];
						var status=log['status'];
						if(status==1){
							status="待审核";
						}
						html+='<li class="clearfix">'+
				    		'<div class="l4">'+log['name']+'<br/>ID'+log['user_id']+'</div>'+
				    		'<div class="l4">'+log['goods_name']+'</div>'+
				    		'<div class="l4">'+log.nums+'</div>'+
				    		'<div class="l4">'+log['money']+'</div>'+
				    		'<div class="l4">'+log.add_time+'</div>'+
				    		'<div class="l4" onclick="sh('+log.id+',this)">'+status+'</div>'+
			    			'</li>';
					}
				}else{
					$("#no_record").show();
				}
				$(".re").append(html);
				
			}
		});
		
		}				
	})
	
</script>
